﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfNet8Test.Model;

namespace WpfNet8Test.ZEFcore
{
    public class AppDbContext:DbContext
    {
        public DbSet<User> Users { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            // 配置 MySQL 连接字符串
            optionsBuilder.UseMySql(
                "server=localhost;database=wpfdemo;user=root;password=xiaochentech123@;port=3306;charset=utf8mb4",
                new MySqlServerVersion(new Version(9, 4, 0))
            );
        }
    }
}
